From: Dmitry Gutov Date: Thu, 22 Apr 2021 00:29:09 +0000 (+0300) Subject: Move part of the fix from project to xref X-Git-Tag: archive/raspbian/1%29.2+1-2+rpi1^2~5^2~18^2~3025 X-Git-Url: https://dgit.raspbian.org/%22http:/www.example.com/cgi/%22https:/www.github.com/%22bookmarks:///%22http:/www.example.com/cgi/%22https:/www.github.com/%22bookmarks:/?a=commitdiff_plain;h=eadf4cff7cff116d73f007dcfb1d636e9938df51;p=emacs.git Move part of the fix from project to xref * lisp/progmodes/project.el (project--find-regexp-in-files): Don't unquote file names here. * lisp/progmodes/xref.el (xref-matches-in-files): Do it here. And only if the first element in the list is quoted (bug#47799). --- diff --git a/lisp/progmodes/project.el b/lisp/progmodes/project.el index 1d0d1bc58a4..1023b75e668 100644 --- a/lisp/progmodes/project.el +++ b/lisp/progmodes/project.el @@ -787,11 +787,7 @@ pattern to search for." (defun project--find-regexp-in-files (regexp files) (unless files (user-error "Empty file list")) - (let ((xrefs (xref-matches-in-files - regexp - ;; FIXME: `xref-matches-in-files' should work with - ;; quoted filenames. - (mapcar #'file-name-unquote files)))) + (let ((xrefs (xref-matches-in-files regexp files))) (unless xrefs (user-error "No matches for: %s" regexp)) xrefs)) diff --git a/lisp/progmodes/xref.el b/lisp/progmodes/xref.el index 3d2f21ab52f..5d99915347b 100644 --- a/lisp/progmodes/xref.el +++ b/lisp/progmodes/xref.el @@ -1534,6 +1534,8 @@ FILES must be a list of absolute file names." #'tramp-file-local-name #'file-local-name) files))) + (when (file-name-quoted-p (car files)) + (setq files (mapcar #'file-name-unquote files))) (with-current-buffer output (erase-buffer) (with-temp-buffer